package com.icexxx.prime;

public class Main1 {

    public static void main(String[] args) {
        int n = 100000;
        long t1 = System.currentTimeMillis();
        int count = 0;
        for (int i = 2; i < n; i++) {
            if (isPrime(i)) {
                count++;
            }
        }
        long t2 = System.currentTimeMillis();
        System.out.println("count=" + count);
        System.out.println("time=" + (t2 - t1));
    }

    private static boolean isPrime(int num) {
        for (int i = 2; i < num; i++) {
            if (num % i == 0) {
                return false;
            }
        }
        return true;
    }

}

//count=25
//time=0
//count=168
//time=0
//count=1229
//time=15
//count=9592
//time=1779
